<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        // put your code here
        $serveur="localhost";
        $user="root"; 
        $password="root"; 
        $bd = "repertoire"; 

        $connexion_serveur = mysqli_connect($serveur, $user, $password, $bd); 

        if (mysqli_connect_errno()) { 
            echo ("Echec de la connexion : erreur n°". mysqli_connect_errno()." / ". 
            mysqli_connect_error()); 
        } 
        else { 
            echo "Connexion au serveur MySQL > OK !";
        }
        
        
        $sql = "SELECT * FROM contact";
    
        $req = mysqli_query($connexion_serveur, $sql); 
        
        while($resultats = mysqli_fetch_assoc($req)) {
            echo "<div>Nom : ".$resultats["nom"]."</div>"; 
        }
        
             
        ?>
    </body>
</html>
